package controlSoftware.GUI;

import javax.swing.ImageIcon;


/** 
 * User object that is associated with a device. Stores user specific information
 * @author Jiaxi
 *
 */
public class User {

	private int nMappedDevice;
	private String sFirstName;
	private String sLastName;
	private int nSecurityLevel;
	private ImageIcon userIcon;
	
	public User(){
		this.sFirstName = null;
		this.sLastName = null;
		this.nMappedDevice = -1; // During initialization, user is not mapped to any device
		this.userIcon = new ImageIcon("img/image_icon.png"); // use default image icon
	}

	
	public String getsFirstName() {
		return this.sFirstName;
	}

	public void setsFirstName(String sFirstName) {
		if (sFirstName != null)
			this.sFirstName = sFirstName;
	}

	public String getsLastName() {
		return this.sLastName;
	}

	public void setsLastName(String sLastName) {
		if (sLastName != null)	
			this.sLastName = sLastName;
	}

	public void setsIcon(String iconPath) {
		if (iconPath!= null)
			this.userIcon = new ImageIcon (iconPath);
	}
	
	public int getnSecurityLevel() {
		return this.nSecurityLevel;
	}

	public void setnSecurityLevel(int nSecurityLevel) {
		this.nSecurityLevel = nSecurityLevel;
	}


	public ImageIcon getIcon() {
		return this.userIcon;
	}


	public void setsMappedDevice(Integer id) {
		this.nMappedDevice = id;	
	}
	
	public int getsMappedDevice(){
		return this.nMappedDevice;
	}
	
}
